﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Com.Grubbland.Data.Access;

public partial class RequestContent : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

        if (IsPostBack)
        {
            //PublicServiceImpl svc = new PublicServiceImpl();
            //string filename = "";

            //if (FileUpload1.HasFile)
            //{
            //    filename = FileUpload1.FileName;
            //}

            //svc.RequestContent(Profile.UserName, ContentRequest.Text, FileUpload1.FileName);
        }

    }

    protected void OnSendRequest(object sender, EventArgs e)
    {
        //LoginView.FindControl("loginName")

            PublicServiceImpl svc = new PublicServiceImpl();
            string filename = "";

            TextBox txt = (TextBox)LoginView1.FindControl("ContentRequest");
            FileUpload fu = (FileUpload)LoginView1.FindControl("FileUpload1");

            if (fu.HasFile )
            {
                filename = fu.FileName;
            }

            if (svc.RequestContent(Profile.UserName, txt.Text, filename))
            {

            }
            else
            {

            }
    }
}
